package com.item.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//设置响应类型，状态码，响应数据
@NoArgsConstructor
@AllArgsConstructor
@Data
public class Result<T> {
   private Integer code;//状态码
   private String message;//操作信息
   private T date;//响应数据

   public static <E> Result<E> success(E date){return new Result<>(200,"完成操作",date);}
public static Result success(){return new Result(200,"操作成功",null);}
public  static Result error(String message){return new Result(1,message,null);}

}
